home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / DEG2RAD.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  53 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-11-15 ╟─╖
  5.  │  │ FILE NAME   DEG2RAD .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16.  This little function is for those of you who, like me, either failed
  17.  Geometry or/and were sailors and/or are more use to dealing with circles
  18.  in degrees instead of radians. For me a circle STARTS at the top (North)
  19.  and things proceed in a clockwise mannor where East is 90°, South is 180°,
  20.  and West is at 270°. Both of these use pPi# so you will need PUBLICS.INC
  21.  or at least the PUBLIC variable pPi# laying around somewhere.
  22. $endif
  23.  
  24. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  25. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  26. $INCLUDE "PUBLICS.INC"                         ' uses pPi# too
  27. $INCLUDE "DAS-NBV1.INC"                        '
  28.                                                '
  29. CLS                                            '
  30. SCREEN 12                                      '
  31. LOCATE  7, 41 : PRINT "0°"                     '
  32. LOCATE 15, 55 : PRINT "90°"                    '
  33. LOCATE 24, 39 : PRINT "180°"                   '
  34. LOCATE 15, 24 : PRINT "270°"                   '
  35.                                                '
  36. X% = 319                                       '
  37. Y% = 240                                       '
  38. LINE (X%,0)-(X%,479), 8                        ' X,Y lines
  39. LINE (0,Y%)-(639,Y%), 8                        '
  40. StartR# = fDeg2Rad#( 0 )                       ' gotta start somewhere
  41. FOR R% = 10 TO 360 STEP 10                     ' every 10 degrees
  42.   EndR# = fDeg2Rad#( R% )                      ' note that start/end are
  43.   CIRCLE (X%,Y%), 100, 15, -EndR#, -StartR#, 1 ' reversed when using CIRCLE
  44.   StartR# = EndR#                              ' with Degrees
  45.   IF INSTAT THEN EXIT FOR                      '
  46. NEXT                                           ' Ya' gotta' play with this
  47.                                                ' puppy for a while but it
  48. WHILE NOT INSTAT : WEND                        ' works just fine!
  49. CLS                                            '
  50. SCREEN 0                                       '
  51.  
  52.  
  53.